<?php

use Phalcon\Forms\Form;
use Phalcon\Forms\Element\Text;
use Phalcon\Forms\Element\Select;
use Phalcon\Forms\Element\Submit;
use Phalcon\Validation\Validator\Email;
use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\Numericality;

/**
 * Class UserForm
 */
class AddUserForm extends Form {

    /**
     * @inheritdoc
     */
    public function initialize() {
        $this->getName();
        $this->getGender();
        $this->getJob();
    }

    public function getName () {
        $element = new Text('name');
        $element
            ->setLabel('Full Name: ')
            ->setFilters(array('striptags', 'string'));
        $this->add($element);
    }

    public function getGender () {
        $element = new Select('gender', array(
            '1'   => 'Male',
            '0'   => 'Female'
        ));
        $element->setLabel('Gender: ');
        $this->add($element);
    }

    public function getJob () {
        $element = new Text('job');
        $element
            ->setLabel('Job Title: ')
            ->setFilters(array('striptags', 'string'));
        $this->add($element);
    }

}